#ifndef __ANRY_STOCK_LIBRARY_PLATFORM_H__
#define __ANRY_STOCK_LIBRARY_PLATFORM_H__

#ifdef _WIN32

// socket related
#include <winsock2.h>
typedef int socklen_t;

// uniform integer define
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;

#else /* _WIN32 */

// socket related
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
typedef int SOCKET;
#define INVALID_SOCKET (SOCKET)(~0)
#define SOCKET_ERROR (-1)
#define closesocket(sock) close(sock)

// uniform integer define
#include <stdint.h>

#endif /* _WIN32 */

#endif /* __ANRY_STOCK_LIBRARY_PLATFORM_H__ */
